<html>
<head><meta charset="utf-8"><title>slicing in constants · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html">slicing in constants</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="154915817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915817">(Jan 11 2019 at 13:11)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7887d3ee9100c4f5d39b6a243e8bf00e" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7887d3ee9100c4f5d39b6a243e8bf00e">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7887d3ee9100c4f5d39b6a243e8bf00e</a></p>
<p>How hard would be to have this compiling correctly?</p>



<a name="154915892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915892">(Jan 11 2019 at 13:12)</a>:</h4>
<p><span class="user-mention" data-user-id="131070">@Luca Barbato</span> not easy. as the msg awkwardly indicates, slicing is a function call. it's calling a method on a trait, to be precise.</p>



<a name="154915902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915902">(Jan 11 2019 at 13:12)</a>:</h4>
<p>I know about Index :)</p>



<a name="154915903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915903">(Jan 11 2019 at 13:12)</a>:</h4>
<p>so fixing this requires finding a solution for "which trait methods can const code call"</p>



<a name="154915918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915918">(Jan 11 2019 at 13:13)</a>:</h4>
<p>and that's a tough question because you have to make sure that the trait method was implemented with const code only</p>



<a name="154915926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154915926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154915926">(Jan 11 2019 at 13:13)</a>:</h4>
<p>see <a href="https://github.com/rust-rfcs/const-eval/pull/8" target="_blank" title="https://github.com/rust-rfcs/const-eval/pull/8">https://github.com/rust-rfcs/const-eval/pull/8</a> for the current discussion about that</p>



<a name="154916072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slicing%20in%20constants/near/154916072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Luca Barbato <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slicing.20in.20constants.html#154916072">(Jan 11 2019 at 13:16)</a>:</h4>
<p>I guess I should rethink that part for the time being :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>